<?php

class Application_Model_Empresas
{
	protected $_id_empresa;
	protected $_titulo;
	protected $_texto;
	protected $_imagen;
	protected $_imagen_tipo;
	protected $_direccion;
	protected $_actividad;
	protected $_cp;
	protected $_localidad;
	protected $_telefono;
	protected $_fax;
	protected $_email;
	
	public function __construct(array $options = null)
    {
        if (is_array($options)) {
            $this->setOptions($options);
        }
    }
 
    public function __set($name, $value)
    {
        $method = 'set' . $name;
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('Invalid clientes property');
        }
        $this->$method($value);
    }
 
    public function __get($name)
    {
        $method = 'get' . $name;
        if (('mapper' == $name) || !method_exists($this, $method)) {
            throw new Exception('La propiedad no existe en la clase Application_Model_Clientes');
        }
        return $this->$method();
    }
 
    public function setOptions(array $options)
    {
        $methods = get_class_methods($this);
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (in_array($method, $methods)) {
                $this->$method($value);
            }
        }
        return $this;
    }
	
	public function setId_empresa($text)
    {
        $this->_id_empresa = (string) $text;
        return $this;
    }
 
    public function getId_empresa()
    {
    	if($this->_id_empresa == '') $this->_id_empresa = null;
        return $this->_id_empresa;
    }
    
	public function setTitulo($text)
    {
        $this->_titulo = (string) $text;
        return $this;
    }
 
    public function getTitulo()
    {
        return $this->_titulo;
    }
    
	public function setTexto($text)
    {
    	if($text == '') $text = null;
        $this->_texto = $text;
        return $this;
    }
 
    public function getTexto()
    {
        return $this->_texto;
    }
    
	public function setImagen($text)
    {
    	if($text == '') $text = null;
        $this->_imagen = $text;
        return $this;
    }
 
    public function getImagen()
    {
        return $this->_imagen;
    }
    
	public function setImagen_tipo($text)
    {
    	if($text == '') $text = null;
        $this->_imagen_tipo = $text;
        return $this;
    }
 
    public function getImagen_tipo()
    {
        return $this->_imagen_tipo;
    }
    
	public function setDireccion($text)
    {
    	if($text == '') $text = null;
        $this->_direccion = $text;
        return $this;
    }
 
    public function getDireccion()
    {
        return $this->_direccion;
    }
    
	public function setActividad($text)
    {
    	if($text == 0) $text = null;
        $this->_actividad = $text;
        return $this;
    }
 
    public function getActividad()
    {
        return $this->_actividad;
    }
    
	public function setCp($text)
    {
    	if($text == '') $text = null;
        $this->_cp = $text;
        return $this;
    }
 
    public function getCp()
    {
        return $this->_cp;
    }
    
	public function setLocalidad($text)
    {
    	if($text == '') $text = null;
        $this->_localidad = $text;
        return $this;
    }
 
    public function getLocalidad()
    {
        return $this->_localidad;
    }
    
	public function setTelefono($text)
    {
    	if($text == '') $text = null;
        $this->_telefono = $text;
        return $this;
    }
 
    public function getTelefono()
    {
        return $this->_telefono;
    }
    
	public function setFax($text)
    {
    	if($text == '') $text = null;
        $this->_fax = $text;
        return $this;
    }
 
    public function getFax()
    {
        return $this->_fax;
    }
    
	public function setEmail($text)
    {
    	if($text == '') $text = null;
        $this->_email = $text;
        return $this;
    }
 
    public function getEmail()
    {
        return $this->_email;
    }
}

